package com.sx.micowell.module.course.video

import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.miloyu.modelnet.response.CourseDetailList
import com.miloyu.modelnet.response.CourseVideoVO
import com.miloyu.modelnet.response.LearnedCourseVO
import com.miloyu.modelnet.response.getUrl
import com.sx.micowell.R

/**
 * @Author: YY
 * @Time: 2021/9/6
 * @Describe TODO
 */
class CourseActionListAdapter : BaseQuickAdapter<CourseDetailList, BaseViewHolder>(R.layout.item_action_list) {

    override fun convert(holder: BaseViewHolder, item: CourseDetailList) {
        Glide.with(context).load(item.cover.getUrl())
            .into((holder.getView<View>(R.id.image_title) as ImageView))

        holder.setVisible(R.id.image_vip, item.isVip == "Y")
        holder.setText(R.id.tv_title, item.title)
        holder.setText(R.id.tv_content, "${item.actionCount}次" )
    }
}